import Stats from 'stats.js'

let flushStats;

/**
 * 屏幕帧数显示
 */

function flush(dom = document.body) {
    if (!flushStats) {
        flushStats = new Stats();
        flushStats.domElement.style.position = 'absolute';
        flushStats.domElement.style.top = '0px';
        dom.appendChild(flushStats.domElement);
    }
    flushStats.update()
}

export default {
    flush
}